<!-- / toaster directive -->
<!-- 导航条 -->
<toaster-container
toaster-options="{'position-class': 'toast-top-right', 'close-button':true}"></toaster-container>

<div class="bg-white bread-crumb">
    <ul class="breadcrumb b-a m-b-n-xs lter b-b wrapper-md">
        <li><a ui-sref="main"><i class="glyphicon glyphicon-log-in"></i> 门禁管理</a></li>
        <li class="active" ng-bind="title"></li>
    </ul>
</div>
<!--读卡-->
<object classid="clsid:727B872C-BB7A-418E-82D5-D99FF36F7C4E" codebase="../IdCardRead.msi" id="IdCardRead" width="0"
        height="0">
</object>

<object classid="clsid:2FF94F50-4070-428B-8049-AA7F4153DBEB" codebase="../webSerial.msi" width="0" height="0" id="webSerial" name="webSerial">
</object>

<!--华视电子身份证读卡-->
<object id="CertCtl" type="application/cert-reader" width="0" height="0">	
</object>
<!-- 内容区域 -->
<div class="wrapper-md content">
    <div class="panel panel-default">
        <!-- 头部 -->
        <div class="panel-heading font-bold">
            <!--<a class="btn btn-sm btn-icon btn-rounded btn-default pull-right m-t-n-xs"
               ui-sref="main.authm.cardAuth.list">
               <i class="text-md glyphicon glyphicon-chevron-up text-muted"></i>
            </a>-->
        </div>
        <!--表单-->
        <div class="panel-body" id="AddNewMenber">
            <form class="form-horizontal" name="user_form">
            	<div class="essential-information">
                    <h6 style="margin-top: 0px;">基本信息</h6>
                    <!--<hr style="margin-top: 0;margin-bottom: 20px;padding: 0">-->
                    <div class="line line-dashed b-b line-lg pull-in"></div>
                    <!--人员类型-->
                    <div class="form-group">
                        <label class="col-lg-2 col-sm-3 control-label" for="PersonType">
                            <span class="text-danger wrapper-sm">*</span>人员类型：
                        </label>
                        <div class="col-lg-4">
                            <span style="display: inline-block;width: 100px;line-height: 40px">
                                <input ng-checked="true" name="personType" type="radio" value="0" ng-model="record.personType" ng-change="rewriteInfo()"/>
                                租客
                            </span>
                            <span style="display: inline-block;width: 100px;line-height: 40px">
                                <input  name="personType" type="radio" value="1" ng-model="record.personType" ng-change="rewriteInfo()"/>
                                房东
                            </span>
                        </div>
                    </div>
                    <div class="line line-dashed b-b line-lg pull-in"></div>
                    <!--身份证号-->
                    <div class="form-group">
                        <label class="col-lg-2 col-sm-3 control-label" for="IDCardNo">
                            <span class="text-danger wrapper-sm">*</span>身份证号：
                        </label>
                        <div class="col-sm-6">
                            <input type="text" class="form-control" name="IDCardNo"id="IDCardNo" placeholder="请填写身份证号..."
                                   ng-model="record.IDCardNo" ng-blur="checkIDCardNo()" >
                        </div>
                        <span class="readCard" ng-click="readCert()" ng-model="cardStatus">{{cardStatus}}</span>
                    </div>
                    <!--照片-->
                    <div class="form-group">
                        <label class="col-lg-2 col-sm-3 control-label" for="fileInput">
                            <span class="text-danger wrapper-sm"></span>照片：
                        </label>
                        <div class="col-lg-4" style="position: relative;">
                            <img id="headImag" style="height:80px;width:80px;position: absolute;left: 15px;top: -19px;cursor: pointer">
                            <input type="file" name="fileInput" id="fileInput" class="form-control"
                                   style="margin-top: 0;opacity: 0;width: 100%;height:44px"/ disabled="disabled">
                        </div>
                    </div>
                    <div class="line line-dashed b-b line-lg pull-in"></div>
                   	<!--用户名-->
	                <div class="form-group">
	                    <label class="col-lg-2 col-sm-3 control-label" for="personName">
	                    	<span class="text-danger wrapper-sm">*</span>姓名：
	                    </label>
	                    <div class="col-lg-4">
	                        <input type="text" class="form-control" name="personName"id="personName"ng-model="record.personName" ng-disabled="inputDisable"
	                        placeholder="请填写人员姓名..." >
	                    </div>
<!--	                    <input type="text" class="form-control" name="personId" ng-hide="true"id="personId" ng-model="record.personId" required>-->
	                </div>
                   <!--性别-->
                    <div class="form-group">
                        <label class="col-lg-2 col-sm-3 control-label" for="sex">
                            <span class="text-danger wrapper-sm">*</span>性别：
                        </label>
                        <div class="col-lg-4">
                            <span style="display: inline-block;width: 100px;line-height: 40px">
                                <input ng-checked="true" name="sex" type="radio" value="1" ng-model="record.sex" ng-disabled="inputDisable"/>
                                男
                            </span>
                            <span style="display: inline-block;width: 100px;line-height: 40px">
                                <input  name="sex" type="radio" value="2" ng-model="record.sex" ng-disabled="inputDisable"/>
                                女
                            </span>
                        </div>
                    </div>
                    <div class="line line-dashed b-b line-lg pull-in"></div>
                    <!--民族-->
                    <div class="form-group">
                        <label class="col-lg-2 col-sm-3 control-label" for="nation">
                            <span class="text-danger wrapper-sm">*</span>民族：
                        </label>
                        <div class="col-lg-4">
                            <select name="nation" id="nation" ng-model="record.nation" class="form-control" ng-disabled="inputDisable">	
                                <option value="01">汉族</option>
                                <option value="02">蒙古族</option>
                                <option value="03">回族</option>
                                <option value="04">藏族</option>
                                <option value="05">维吾尔族</option>
                                <option value="06">苗族</option>
                                <option value="07">彝族</option>
                                <option value="08">壮族</option>
                                <option value="09">布依族</option>
                                <option value="10">朝鲜族</option>
                                <option value="11">满族</option>
                                <option value="12">侗族</option>
                                <option value="13">瑶族</option>
                                <option value="14">白族</option>
                                <option value="15">土家族</option>
                                <option value="16">哈尼族</option>
                                <option value="17">哈萨克族</option>
                                <option value="18">傣族</option>
                                <option value="19">黎族</option>
                                <option value="20">傈僳族</option>
                                <option value="21">佤族</option>
                                <option value="22">畲族</option>
                                <option value="23">高山族</option>
                                <option value="24">拉祜族</option>
                                <option value="25">水族</option>
                                <option value="26">东乡族</option>
                                <option value="27">纳西族</option>
                                <option value="28">景颇族</option>
                                <option value="29">柯尔克孜族</option>
                                <option value="30">土族</option>
                                <option value="31">达斡尔族</option>
                                <option value="32">仫佬族</option>
                                <option value="33">羌族</option>
                                <option value="34">布朗族</option>
                                <option value="35">撒拉族</option>
                                <option value="36">毛南族</option>
                                <option value="37">仡佬族</option>
                                <option value="38">锡伯族</option>
                                <option value="39">阿昌族</option>
                                <option value="40">普米族</option>
                                <option value="41">塔吉克族</option>
                                <option value="42">怒族</option>
                                <option value="43">乌孜别克族</option>
                                <option value="44">俄罗斯族</option>
                                <option value="45">鄂温克族</option>
                                <option value="46">德昂族</option>
                                <option value="47">保安族</option>
                                <option value="48">裕固族</option>
                                <option value="49">京族</option>
                                <option value="50">塔塔尔族</option>
                                <option value="51">独龙族</option>
                                <option value="52">鄂伦春族</option>
                                <option value="53">赫哲族</option>
                                <option value="54">门巴族</option>
                                <option value="55">珞巴族</option>
                                <option value="56">基诺族</option>
                                <option value="59">穿青人</option>
                                <option value="60">亻革家人</option>
                                <option value="98">外国血统</option>
                                <option value="99">其它</option>
                            </select>
                        </div>
                    </div>
                    <!--出生日期-->
                    <div class="form-group">
	                    <label class="col-lg-2 col-sm-3 control-label" for="birthday"><span class="text-danger wrapper-sm">*</span>出生日期：</label>
	                    <div class="col-lg-4">
	                        <div class="input-group m-d"style="position: relative">
	                            <input type="text"
	                                   class="form-control ng-pristine ng-valid ng-isolate-scope ng-empty ng-valid-date ng-touched"
	                                   name="birthday" current-text="今天" clear-text="清除" close-text="关闭"
	                                   ng-model="record.birthday" datepicker-popup="yyyy-MM-dd" 
	                                   id="birthday" is-open="birthday" datepicker-options="birthOptions"
	                                   placeholder="请选择出生日期..."  ng-disabled="inputDisable" readonly="readonly"
	                            >
	                            <span class="input-group-btn">
									<button type="button" class="btn btn-default" ng-click="openDatepicker($event,1)">
									<i class="glyphicon glyphicon-calendar"></i>
									</button>
								</span>
	                        </div>
	                    </div>
	                </div>
                    <div class="line line-dashed b-b line-lg pull-in"></div>
                    <!-- 户籍地址 -->
                    <div class="form-group">
                        <label class="col-lg-2 col-sm-3 control-label" for="censusAddress">
                            <span class="text-danger wrapper-sm">*</span>户籍地址：
                        </label>
                        <div class="col-lg-4">
                            <input type="text" class="form-control" name="censusAddress" id="censusAddress"
                                   placeholder="请填写户籍地址..." ng-model="record.censusAddress" ng-disabled="inputDisable"> <span
                                class="help-block m-b-none"></span>
                        </div>
                    </div>
                    <!--手机号码-->
                    <div class="form-group">
                        <label class="col-lg-2 col-sm-3 control-label" for="mobileNo">
                            <span class="text-danger wrapper-sm">*</span>手机号码：
                            <br /><span>(用于登陆APP)</span>
                        </label>
                        <div class="col-lg-4">
                            <input type="text" class="form-control" name="mobileNo" id="mobileNo"
                                   placeholder="请填写手机号码..." ng-model="record.mobileNo" 
                                   ng-blur="checkPhoneNumber()"  >
                        	<span ng-show="isuse" style="color: red;">手机号码已经被使用，请输入新的号码！</span>
                        </div>
                    </div>
                    <div class="line line-dashed b-b line-lg pull-in"></div>
                </div>
                <div class="essential-information">
                    <h6 style="margin-top: 0px;">居住信息</h6>
                    <div class="line line-dashed b-b line-lg pull-in"></div>
                    <!--开始时间-->
                    <div class="form-group">
	                    <label class="col-lg-2 col-sm-3 control-label" for="startDate"><span class="text-danger wrapper-sm">*</span>开始时间：</label>
	                    <div class="col-lg-4">
	                        <div class="input-group m-d"style="position: relative">
	                            <input type="text"
	                                   class="form-control ng-pristine ng-valid ng-isolate-scope ng-empty ng-valid-date ng-touched"
	                                   name="startDate" current-text="今天" clear-text="清除" close-text="关闭"
	                                   ng-model="record.startDate" datepicker-popup="yyyy-MM-dd"
	                                   id="startDate" is-open="startDate" datepicker-options="liveOptions"
	                                   placeholder="请选择开始居住时间..." readonly="readonly" ng-change="dateJudge('startDate')"
	                            >
	                            <span class="input-group-btn">
									<button type="button" class="btn btn-default" ng-click="openDatepicker($event,2)">
									<i class="glyphicon glyphicon-calendar"></i>
									</button>
								</span>
	                        </div>
	                    </div>
	                </div>
                    <!--结束时间-->
                    <div class="form-group">
	                    <label class="col-lg-2 col-sm-3 control-label" for="endDate"><span class="text-danger wrapper-sm">*</span>结束时间：</label>
	                    <div class="col-lg-4">
	                        <div class="input-group m-d"style="position: relative">
	                            <input type="text"
	                                   class="form-control ng-pristine ng-valid ng-isolate-scope ng-empty ng-valid-date ng-touched"
	                                   name="endDate" current-text="今天" clear-text="清除" close-text="关闭"
	                                   ng-model="record.endDate" datepicker-popup="yyyy-MM-dd"
	                                   id="endDate" is-open="endDate" datepicker-options="liveOptions"
	                                   placeholder="请选择结束居住时间..." readonly="readonly" ng-change="dateJudge('endDate')"
	                            >
	                            <span class="input-group-btn">
									<button type="button" class="btn btn-default" ng-click="openDatepicker($event,3)">
									<i class="glyphicon glyphicon-calendar"></i>
									</button>
								</span>
	                        </div>
	                    </div>
	                </div>
	                <div class="line line-dashed b-b line-lg pull-in"></div>	
	                <!--楼栋地址-->
	                <div class="form-group" style="width: 100%">
	                    <label class="col-lg-2 col-sm-3 control-label" for="bname" style="width: 12.5%"><span class="text-danger wrapper-sm">*</span>楼栋地址：</label>
	                    <div class="col-sm-9" style="width: 82%;">
	                        <input type="text" class="form-control" name="buildingAddress"id="buildingAddress"  
	                        ng-model="buildingAddress" ng-click="openInfo()" 
	                        placeholder="请选择楼栋地址..." ng-disabled="{{isreadonly}}">
	                    </div>
	                    <!--<span class="readCard" ng-click="addBuilding()">新增</span>-->
	                </div>
	                <div class="line line-dashed b-b line-lg pull-in"></div>
	            </div>	
	            <div class="essential-information">
                    <h6 style="margin-top: 0px;">授权信息</h6>
                    <div class="line line-dashed b-b line-lg pull-in"></div>
	                <!--身份证-->
	                <div class="form-group">
	                    <label class="col-lg-2 col-sm-3 control-label" for="idCardUID">身份证UID：</label>
	                    <div class="col-sm-6">
	                        <input type="text" class="form-control"name="idCardUID"id="idCardUID" placeholder="请输入身份证UID..."
	                               ng-model="record.idCardUID">
                            <p class="reminder" ng-if="cardUUIDStatus">*请把卡放在读卡器上{{cardCountDownTxt}}</p>
	                    </div>
	                    <span class="readCard" ng-click="readIdCard()">{{cardUUIDStatus?'读取中':'读卡'}}</span>
	                </div>
	                 <!--APP开门-->
					<div class="form-group">
	                    <label class="col-lg-2 col-sm-3 control-label"><span class="text-danger wrapper-sm">*</span>APP开门：</label>
	                    <div class="col-sm-6">
	                        <span style="display: inline-block;width: 100px;line-height: 40px"><input ng-checked="true" name="appAvalible" type="radio" value="1" ng-value="1" ng-model="record.appAvalible"/>启用</span>
	                        <span style="display: inline-block;width: 100px;line-height: 40px"><input  name="appAvalible" type="radio" value="0" ng-value="0" ng-model="record.appAvalible"  />禁用</span>
	                    </div>
	                </div>
	                <div class="line line-dashed b-b line-lg pull-in"></div>
					<!--居住证-->
					<div class="form-group">
	                    <label class="col-lg-2 col-sm-3 control-label" for="liveCardUID" >居住证UID：</label>
	                    <div class="col-sm-6">
	                        <input type="text" class="form-control" name="liveCardUID"id="liveCardUID" placeholder="请输入居住证UID..." ng-model="record.liveCardUID">
                            <p class="reminder" ng-if="liveCardUUIDStatus">*请把卡放在读卡器上</p>
	                    </div>
	                    <span class="readCard" ng-click="readLiveCard()">{{liveCardUUIDStatus?'读取中':'读卡'}}</span>
	                </div>
	                <!--结束时间-->
	                <div class="form-group">
	                    <label class="col-lg-2 col-sm-3 control-label" for="endTime"><span class="text-danger wrapper-sm">*</span>结束时间：</label>
	                    <div class="col-lg-4" style="width: 50%;">
	                        <div class="input-group m-d"style="position: relative">
	                            <input type="text"
	                                   class="form-control ng-pristine ng-valid ng-isolate-scope ng-empty ng-valid-date ng-touched"
	                                   name="endTime" current-text="今天" clear-text="清除" close-text="关闭"
	                                   ng-model="record.endTime" datepicker-popup="yyyy-MM-dd"
	                                   id="endTime" is-open="endTime" datepicker-options="authOptions"
	                                   placeholder="请选择结束授权时间..."  readonly="readonly"
	                            >
	                            <span class="input-group-btn">
									<button type="button" class="btn btn-default" ng-click="openDatepicker($event,4)">
									<i class="glyphicon glyphicon-calendar"></i>
									</button>
								</span>
	                            <div class="timelimit">
	                                <span ng-click="chooceTime(3)">3个月</span>
	                                <span ng-click="chooceTime(6)">6个月</span>
	                                <span ng-click="chooceTime(12)">一年</span>
	                                <span ng-click="chooceTime()">永久</span>
	                            </div>
	                        </div>
	
	                    </div>
	                </div>
	                <div class="line line-dashed b-b line-lg pull-in"></div>
	                <!--IC卡-->
	                <div class="form-group" style="position: relative;">
	                    <label class="col-lg-2 col-sm-3 control-label">IC卡号：</label>
	                    <div class="col-sm-6" >
                        <div style="width: 100%;min-height: 35px;vertical-align: middle;border-radius: 4px;padding: 0;display: inline-block;border: 1px solid #bdc3c7;">
                            <div ng-repeat="p in record.icCardUIDs track by $index" style="position: relative;" >
                                    <input type="text" class="form-control ICCardinput"   name="IcCardNo" placeholder="请输入IC卡号{{$index}}..." ng-model="record.icCardUIDs[$index]" style="border:none" />
                                    <span class="inputClose" ng-click="del($index)"></span>
                            </div>
                            <div style="position: relative;"ng-show="record.icCardUIDs.length<=0">
                                <div style= " position: absolute;top:0px;">
                                    <input type="text" class="form-control ICCardinput"ng-model="record.icCardUIDs[0]" placeholder="请输入IC卡号..." style="border: none;height: 33px;" readonly>
                                </div>
                            </div>
                        </div>
	                        
	                       <p class="reminder" ng-if="icCardUUIDStatus">*请把卡放在读卡器上</p>
	                       <!--用来预先占位置，当record.icCardUIDs大于0时隐藏起来-->
                           <!---*******************************--->
                            
                            <!---********************************--->
                        </div>
                        <span class="readCard" ng-click="readIcCard()">{{icCardUUIDStatus?'读取中':'读卡'}}</span>
                        <!--<button type="button" ng-click="readIcCard()" class="readIcCard">读卡</button>-->
	                </div>
	                <div class="form-group">
	                    <label class="col-lg-2 col-sm-3 control-label"></label>
	                    <div >
	                    	<span>身份证号/居住证号/IC卡号/APP至少要填写一项</span>
	                    </div>
	                </div>
	                <div class="line line-dashed b-b line-lg pull-in"></div>
	                <!--btn-->
	                <div class="form-group" style="width: 100%">
	                    <div class="col-sm-6 col-sm-offset-2 text-center"
	                         style="width: 100%;margin: 0;padding: 0;text-align: center">
	                        <button type="submit" class="btn btn-info w-xs m-l-xl addNew"
	                                ng-disabled="isDisabled">保存   
	                        </button>
	                        <button type="submit" class="btn addNew" ng-click="setSubmitType()" ng-disabled="isDisabled">提交并完善信息</button>
	                    </div>
	                </div>
	            </div>
            </form>
        </div>
    </div>
</div>

<!--姓名模态框-->
<script type="text/ng-template" id="personList.html">

    <div ng-hide="loading" class="wrapper-md content">
        <!-- 数据显示 -->
        <div class="wrapper-data">
            <div class="panel panel-default">
                <!-- 头部 -->
                <div class="panel-heading clearfix">

                    <div class="w-auto">
                        <form ng-submit="searchP()" class="form-inline">
                            <div class="form-group" style="width: 30%">
                                <label for="personName">人员姓名：</label>
                                <input type="text" class="form-control" style="width: 180px"id="personName"name="personName"
                                        placeholder="" ng-model="paramP.personName">
                            </div>
                            <div class="form-group"style="width: 30%">
                                <label for="IDCardNo">身份证：</label>
                                <input type="text" class="form-control" style="width: 180px"id="IDCardNo"name="IDCardNo"
                                       placeholder="" ng-model="paramP.IDCardNo">
                            </div>

                            <button type="submit" class="btn btn-primary new-primary"style="margin-left: 10px">查询</button>

                        </form>
                    </div>
                </div>

                <!-- 数据表格 -->
                <div class="table-responsive">
                    <table class="table table-striped b-t b-light text-center">
                        <thead>
                        <tr>
                            <th>人员姓名</th>
                            <th>身份证号码</th>
                            <th>操作</th>
                        </tr>
                        </thead>
                        <tbody>

                        <tr ng-repeat="item in pageInfo.data">
                            <td class="v-middle">{{item.personName}}</td>
                            <td class="v-middle">{{item.IDCardNo}}</td>
                            <td class="v-middle">
                                <a ng-click="selectPerson(item.personId,item.personName,item.IDCardNo)">选择</a>
                            </td>
                        </tr>
                        </tbody>
                    </table>
                </div>
                <span data-ng-include=" 'src/tpl/pageInfo.html' "></span>
            </div>
        </div>
    </div>
    <div class="modal-footer">
        <button class="btn btn-warning addNew" ng-click="cancel()">取消</button>
    </div>
</script>
<!--现住地址-->
<script type="text/ng-template" id="NowAddress.html">

    <div ng-hide="loading" class="wrapper-md content">
        <!-- 数据显示 -->
        <div class="wrapper-data" style="margin-top: 0">
            <div class="panel panel-default">
                <!-- 头部 -->
                <div class="panel-heading clearfix">

                    <div class="w-auto">
                        <form ng-submit="search()" class="form-inline">
                            <label>楼栋地址：</label>
                            <select name="" class="form-control cityinput" ng-change="getarea()" ng-model="icity.code_" id="city">
                                <option value='' disabled selected style='display:none;'>市区</option>
                                <option ng-repeat="icity in city" value="{{$index}}" data-code="{{icity.code_}}" ng-bind="icity.code_text"></option>
                            </select>
                            <!--区/县-->
                            <select name="" class="form-control cityinput" id="area" ng-change="getStree()" ng-model="iarea.code_">
                                <option value='' disabled selected style='display:none;'>区域</option>
                                <option ng-repeat="iarea in area" value="{{$index}}" data-code="{{iarea.code_}}" ng-bind="iarea.code_text"></option>
                            </select>
                            <!--乡镇/街道-->
                            <select name="" class="form-control cityinput"id="street" ng-change="getRoad()" ng-model="istree.code_">
                                <option value='' disabled selected style='display:none;'>乡镇/街道</option>
                                <option ng-repeat="istree in stree"value="{{$index}}" data-code="{{istree.code_}}" ng-bind="istree.code_text"></option>
                            </select>
                            <!--路-->
                            <select name="" class="form-control cityinput"id="road"ng-change="getQuarters()" ng-model="iroad.code_" >
                                <option value='' disabled selected style='display:none;'>路</option>
                                <option   ng-repeat="iroad in roud"value="{{$index}}" data-code="{{iroad.code_}}" ng-bind="iroad.code_text"></option>
                            </select>
                            <!--小区/门牌-->
                            <select name="" class="form-control cityinput" id="quarters" ng-change="getHouseNo()" ng-model="iquarters.code_">
                                <option value='' disabled selected style='display:none;'>小区/门牌</option>
                                <option ng-repeat="iquarters in quarters"value="{{$index}}" data-code="{{iquarters.code_}}" ng-bind="iquarters.code_text"></option>
                            </select>
                            <!--楼号-->
                            <input name="buildName" class="form-control cityinput" id="buildName"placeholder="楼号..." ng-model="param.buildName"></input>
                            <label>楼栋编号：</label><input type="text" id="buildingNo" class="form-control cityinput"placeholder="楼栋编号" ng-model="param.buildingNo">
                            <label>设备编号：</label><input type="text" id="deviceCode" class="form-control cityinput"placeholder="设备编号" ng-model="param.deviceCode">
                            <label>设备名称：</label><input type="text" id="deviceName" class="form-control cityinput"placeholder="设备名称" ng-model="param.deviceName">
                            <button type="submit" class="btn btn-primary new-primary"style="margin-left: 10px">查询</button>
                        </form>
                    </div>
                </div>

                <!-- 数据表格 -->
                <div class="table-responsive">
                    <table class="table table-striped b-t b-light text-center">
                        <thead>
                        <tr>
                            <th>楼栋编号</th>
                            <th>楼栋地址</th>
                            <th>设备编号</th>
                            <th>设备名称</th>
                            <th>操作</th>
                        </tr>
                        </thead>
                        <tbody>

                        <tr ng-repeat="item in pageInfo.data">
                            <td class="v-middle">{{item.buildingNo}}</td>
                            <td class="v-middle">{{item.buildingAddress}}</td>
                            <td class="v-middle">{{item.deviceCode}}</td>
                            <td class="v-middle">{{item.deviceName}}</td>
                            <td class="v-middle">
                                <a ng-hide="item.deviceCode == null " ng-click="selectBuilding(item.buildingId,item.buildingAddress,item.deviceId)">选择</a>
                            </td>
                        </tr>
                        </tbody>
                    </table>
                </div>
                <span data-ng-include=" 'src/tpl/pageInfo.html' "></span>
            </div>
        </div>
    </div>
    <div class="modal-footer">
        <button class="btn btn-warning addNew" ng-click="cancel()">取消</button>
    </div>
</script>

<!-- 房屋模态框 -->
<script type="text/ng-template" id="personHouseList.html">
    <!-- 内容区域 -->
    <div ng-hide="loading" class="wrapper-md content">
        <!-- 数据显示 -->
        <div class="wrapper-data">
            <div class="panel panel-default">
                <!-- 头部 -->
                <div class="panel-heading clearfix">

                    <div class="w-auto">
                        <form ng-submit="search()" class="form-inline">

                            <div class="form-group">
                                <label for="address">房屋地址：</label>
                                <input type="text"
                                  class="form-control" style="width: 180px"
                                  id="address"
                                  placeholder="" ng-model="param.address">
                            </div>

                            <div class="form-group">
                                <button type="submit" class="btn btn-primary new-primary"
                                        style="margin-left: 10px">查询
                                </button>
                            </div>
                        </form>
                    </div>
                </div>

                <!-- 数据表格 -->
                <div class="table-responsive">
                    <table class="table table-striped b-t b-light text-center">
                        <thead>
                        <tr>
                            <th ng-show="tag==1">选择</th>
                            <th>房屋地址</th>

                            <th ng-show="tag==0">操作</th>
                        </tr>
                        </thead>
                        <tbody>
                        <tr ng-repeat="item in pageInfo.data">
                            <td class="v-middle">{{item.address}}</td>
                            
                            <td ng-show="tag==0" class="v-middle">
                                <a ng-click="selectHouses(item.deviceId,item.address,item.houseId)">选择</a>
                            </td>
                        </tr>
                        </tbody>
                    </table>
                </div><!-- /.table-responsive -->

                <!-- 底部分页 -->
                <span data-ng-include=" 'src/tpl/pageInfo.html' "></span>
            </div><!-- /.panel -->
        </div><!-- /.wrapper-data -->

    </div><!-- /.wrapper-md -->

    <div class="modal-footer">
        <button class="btn btn-info addNew" ng-show="tag==1" ng-click="saveHouse()">确定</button>
        <button class="btn btn-warning addNew" ng-click="cancel()">取消</button>
    </div>
</script>

<!--详细信息模态框-->
<script type="text/ng-template" id="detailInfo.html">
    <div ng-hide="loading" class="wrapper-md content">
        <!-- 数据显示 -->
        <div class="wrapper-data">
            <div class="panel panel-default">
                <!-- 头部 -->
                <div class="panel-heading clearfix">
                    <div class="w-auto">
                        <form class="form-inline form-horizontal" ng-submit="sendDetailInfo()" name="detailInfo" novalidate>
                            <div class="details-Infomation">
			                    <h6>详细信息</h6>
			                    <hr style="margin-top: 0;margin-bottom: 22px;padding: 0"/>
			                   
			                    <div class="form-group">
			                        <!-- 国籍 -->
			                        <label class="col-lg-2 col-sm-3 control-label" for="nationality">
			                            <span class="text-danger wrapper-sm">*</span>国籍：
			                        </label>
			                        <div class="col-lg-4">
			                            <input type="text" class="form-control" name="nationality"
			                                   id="nationality" placeholder="请输入国籍..."
			                                   ng-model="detailParams.nationality" ng-blur = "checkStatus('nationality')">
  											<span style="color:red" ng-show="rNationality">请输入国籍</span>
										</span>
			                        </div>
			                    </div>
			 					
			                    <!-- 移动电话 -->
			                    <div class="form-group">
			                        <label class="col-lg-2 col-sm-3 control-label" for="mobileNo">
			                            <span class="text-danger wrapper-sm">*</span>移动电话：
			                        </label>
			                        <div class="col-lg-4">
			                            <input type="tel" class="form-control" name="mobileNo"
			                                   id="mobileNo" placeholder="请输入移动电话..."
			                                   ng-model="detailParams.mobileNo"
			                                   id="mobileNo"
			                                   
			                                   disabled="disabled"
			                            >
			                            <!--<span ng-show="isuse" style="color: red;">手机号码已经被使用，请输入新的号码！</span>-->
			                        </div>
			                    </div>
			                    <div class="line line-dashed b-b line-lg pull-in"></div>
			                    <div class="form-group">
			                        <!-- 人员状态 -->
			                        <label class="col-lg-2 col-sm-3 control-label" for="personState">
			                            <span class="text-danger wrapper-sm">*</span>人员状态：
			                        </label>
			                        <div class="col-lg-4">
			                            <select class="form-control" ng-model="detailParams.personState" id="personState"
			                                    >
			                                <option value="1">正常</option>
			                                <option value="2">暂停</option>
			                                <option value="3">注销</option>
			                            </select>
			                        </div>
			                    </div> 
			                  
			                       <div class="form-group">
			                        <!-- 避孕动态 -->
			                        <label class="col-lg-2 col-sm-3 control-label"
			                               for="contraceptionState"> <span
			                                class="text-danger wrapper-sm">*</span>避孕动态：
			                        </label>
			                        <div class="col-lg-4">
			                            <select class="form-control" ng-model="detailParams.contraceptionState" id="contraceptionState">
			                                <option value="1">男扎</option>
			                                <option value="2">女扎</option>
			                                <option value="3">上环</option>
			                                <option value="4">服注药</option>
			                                <option value="5">避孕套</option>
			                                <option value="6">外用药</option>
			                                <option value="7">皮埋</option>
			                                <option value="8">其他</option>
			                                <option value="9">未避孕</option>
			                            </select>
			                        </div>
			                    </div>
			                 	<div class="line line-dashed b-b line-lg pull-in"></div>
			                       <!-- 入住时间 -->
			                    <div class="form-group">
			                        <label class="col-lg-2 col-sm-3 control-label" for="liveTime">
			                            <span class="text-danger wrapper-sm">*</span>入住时间：
			                        </label>
			                        <div class="col-lg-4">
			                            <div class="input-group m-d" style="position: relative;width: 105%;">
			                                <input type="text"
			                                       class="form-control ng-pristine ng-valid ng-isolate-scope ng-empty ng-valid-date ng-touched"
			                                       name="detailLiveTime" current-text="今天" clear-text="清除" close-text="关闭"
			                                       datepicker-popup="yyyy-MM-dd" ng-model="detailParams.detailLiveTime"
			                                       id="detailLiveTime" is-open="detailLiveTime" datepicker-options="dateOptions"
			                                       placeholder="请选择入住时间" ng-blur = "checkStatus('detailLiveTime')" readonly="readonly"
			                                >
			                                <span class="input-group-btn">
			                                    <button type="button" class="btn btn-default" ng-click="openDatepicker($event,5)">
			                                        <i class="glyphicon glyphicon-calendar"></i>
			                                    </button>
			                                </span>
			                            </div>
										<span style="color:red;display: block;" ng-show="rDetailLiveTime">请选择入住时间</span>
			                        </div>
			                    </div>
			                    
			                     <div class="form-group">
			                        <!-- 警务区代码 -->
			                        <label class="col-lg-2 col-sm-3 control-label" for="jwqdm"> <span class="text-danger wrapper-sm">*</span>警务区代码：</label>
			                        <div class="col-lg-4">
			                            <input type="text" id="policeAreaId" class="form-control" ng-click="openjwqdm()" ng-blur = "checkStatus('policeAreaId')"
			                                   placeholder="请选择警务区代码" name="jwqdm" ng-model="detailParams.policeAreaId">
										<span style="color:red" ng-show="rPoliceAreaId">请填写警务区代码</span>
			                        </div>
			                    </div>
			                   <div class="line line-dashed b-b line-lg pull-in"></div>
			                 
			  			        <!-- 文化程度 -->
			                    <div class="form-group">
			                        <label class="col-lg-2 col-sm-3 control-label" for="cultureLevel">
			                            文化程度：</label>
			                        <div class="col-lg-4">
			                            <select class="form-control" ng-model="detailParams.cultureLevel" id="cultureLevel">
			                                <option value="90">文盲或半文盲</option>
			                                <option value="80">小学</option>
			                                <option value="70">初中</option>
			                                <option value="60">高中</option>
			                                <option value="50">技工学校</option>
			                                <option value="40">中专或中技</option>
			                                <option value="30">大学专科</option>
			                                <option value="20">大学本科</option>
			                                <option value="10">硕士研究生</option>
			                                <option value="00">博士研究生</option>
			                                <option value="99">其他</option>
			                            </select>
			                        </div>
			                    </div>
			                   
			                    <!-- 证件号码 -->
			                    <div class="form-group">
			                        <label class="col-lg-2 col-sm-3 control-label" for="paperworkNo">
			                            证件号码：</label>
			                        <div class="col-lg-4">
			                            <input type="text" class="form-control" name="paperworkNo"
			                                   id="paperworkNo" placeholder="请输入您的证件号码 ..."
			                                   ng-model="detailParams.IDCardNo">
			                        </div>
			
			                    </div>
			                    
			                    <div class="line line-dashed b-b line-lg pull-in"></div>
			                    <div class="form-group">
			
			                        <!-- 工作单位 -->
			                        <label class="col-lg-2 col-sm-3 control-label" for="company">
			                            工作单位：</label>
			                        <div class="col-lg-4">
			                            <input type="text" class="form-control" name="company"
			                                   id="company" placeholder="请输入您的工作单位 ..."
			                                   ng-model="detailParams.company"> <span
			                                class="help-block m-b-none"></span>
			                        </div>
			                    </div>
			                    
			                    <div class="form-group">
			                        <!-- 工作单位地址 -->
			                        <label class="col-lg-2 col-sm-3 control-label" for="companyAddress">工作单位地址： </label>
			                        <div class="col-lg-4">
			                            <input type="text" class="form-control" name="companyAddress"
			                                   id="companyAddress" placeholder="请输入您的工作单位地址 ..."
			                                   ng-model="detailParams.companyAddress">
			                        </div>
			                    </div>
			                    <div class="line line-dashed b-b line-lg pull-in"></div>
			                    <!-- 单位负责人 -->
			                    <div class="form-group">
			                        <label class="col-lg-2 col-sm-3 control-label"
			                               for="companyManager"> 单位负责人： </label>
			                        <div class="col-lg-4">
			                            <input type="text" class="form-control" name="companyManager"
			                                   id="companyManager" placeholder="请输入您的单位负责人 ..."
			                                   ng-model="detailParams.companyManager">
			                        </div>
			
			                    </div>
			                   
			                    <!-- 单位联系电话 -->
			                    <div class="form-group">
			                        <label class="col-lg-2 col-sm-3 control-label" for="companyPhone">
			                            单位联系电话： </label>
			                        <div class="col-lg-4">
			                            <input type="text" class="form-control" name="companyPhone"
			                                   id="companyPhone" placeholder="请确认您的单位联系电话..."
			                                   ng-model="detailParams.companyPhone"
			                                   pattern="(^(0[0-9]{2,3}\-)?([2-9][0-9]{6,7})+(\-[0-9]{1,4})?$)|(^((\(\d{3}\))|(\d{3}\-))?(1[358]\d{9})$)"
			                            >
			                        </div>
			                    </div>
			                    <div class="line line-dashed b-b line-lg pull-in"></div>
			                   
			 					<div class="form-group">
			                        <!-- 配偶姓名 -->
			                        <label class="col-lg-2 col-sm-3 control-label" for="spouseName">
			                            配偶姓名：</label>
			                        <div class="col-lg-4">
			                            <input type="text" class="form-control" name="spouseName"
			                                   id="spouseName" placeholder="请输入您的配偶姓名 ..."
			                                   ng-model="detailParams.spouseName">
			                        </div>
			                    </div>
			                    
			                    <div class="form-group">
			                        <!-- 固定电话 -->
			                        <label class="col-lg-2 col-sm-3 control-label" for="telephoneNo">固定电话：</label>
			                        <div class="col-lg-4">
			                            <input type="text" class="form-control" name="telephoneNo"
			                                   id="telephoneNo" placeholder="请确认您的固定电话..."
			                                   ng-model="detailParams.telephoneNo"
			                                   pattern="^0\d{2,3}-\d{7,8}(-\d{1,6})?$"
			                            >
			                        </div>
			                    </div>
			                    <div class="line line-dashed b-b line-lg pull-in"></div>
			                    <!-- 重点人员类别 -->
			                    <div class="form-group">
			                        <label class="col-lg-2 col-sm-3 control-label"
			                               for="keyPersonState">重点人员类别：
			                        </label>
			                        <div class="col-lg-4">
			                            <select class="form-control" ng-model="detailParams.keyPersonState" id="keyPersonState"></select>
			                        </div>
			                    </div>
								
			                    <div class="form-group">
			                        <!-- 婚姻状况 -->
			                        <label class="col-lg-2 col-sm-3 control-label" for="marriageState">
			                            <span class="text-danger wrapper-sm">*</span>婚姻状况：
			                        </label>
			                        <div class="col-lg-4">
			                            <select class="form-control" ng-model="detailParams.marriageState" id="marriageState">
			                                <option value="10">未婚</option>
			                                <option value="20">已婚</option>
			                                <option value="21">初婚</option>
			                                <option value="22">再婚</option>
			                                <option value="23">复婚</option>
			                                <option value="30">丧偶</option>
			                                <option value="40">离婚</option>
			                                <option value="90">未说明的婚姻状况</option>
			                            </select>
			                        </div>
			                    </div>
			                    <div class="line line-dashed b-b line-lg pull-in"></div>
			                    <!-- 管理级别 -->
			                    <div class="form-group">
			                        <label class="col-lg-2 col-sm-3 control-label" for="manageLevel">
			                            <span class="text-danger wrapper-sm"></span>管理级别：
			                        </label>
			                        <div class="col-lg-4">
			                            <select class="form-control" ng-model="detailParams.manageLevel" id="manageLevel"> </select>
			                        </div>
			                    </div>
								
			                    <div class="form-group">
			                        <!-- 生育动态 -->
			                        <label class="col-lg-2 col-sm-3 control-label" for="fertilityState"> 生育动态：</label>
			                        <div class="col-lg-4">
			                            <select class="form-control" ng-model="detailParams.fertilityState" id="fertilityState">
			                                <option value="1">已育</option>
			                                <option value="2">未育</option>
			                            </select>
			                        </div>
			                    </div>
			                    <div class="line line-dashed b-b line-lg pull-in"></div>
			                    <!-- 持证情况 -->
			                    <div class="form-group">
			                        <label class="col-lg-2 col-sm-3 control-label"
			                               for="paperworkState"> <span
			                                class="text-danger wrapper-sm"></span>持证情况：
			                        </label>
			                        <div class="col-lg-4">
			                            <select class="form-control" ng-model="paperworkState" id="paperworkState">
			                                <!-- <option value="1">已检</option>
			                                <option value="2">未检</option> -->
			                            </select>
			                        </div>
			                    </div>
								
			                    <div class="form-group">
			                        <!-- 是否已注销 -->
			                        <label class="col-lg-2 col-sm-3 control-label" for="isWriteOff">
			                            <span class="text-danger wrapper-sm">*</span>是否已注销：
			                        </label>
			                        <div class="col-lg-4">
			                            <select class="form-control" ng-model="detailParams.isWriteOff" id="isWriteOff">
			                                <option value="1">已注销</option>
			                                <option value="2">未注销</option>
			                            </select>
			                        </div>
			                    </div>
			                    <div class="line line-dashed b-b line-lg pull-in"></div>
			                      <div class="form-group">
			                        <label class="col-lg-2 col-sm-3 control-label" for="carrer">
			                            职业：</label>
			                        <div class="col-lg-4">
			                            <input type="text" class="form-control" name="carrer"
			                                   id="carrer" placeholder="请输入您的职业..." ng-model="detailParams.carrer">
			                        </div>
			                    </div>
								                    
			                    <div class="form-group">
			                        <!-- 信息录入方式 -->
			                        <label class="col-lg-2 col-sm-3 control-label" for="entryWay">信息录入方式：</label>
			                        <div class="col-lg-4">
			
			                            <select name="entryWay" class="form-control" id="entryWay" ng-model="detailParams.entryWay"
			                                    placeholder="信息录入方式...">
			                                <option value="1">读卡录入</option>
			                                <option value="2">手动录入</option>
			                            </select>
			                        </div>
			                    </div>
			                    <div class="line line-dashed b-b line-lg pull-in"></div>
			                    <div class="form-group">
			                        <!-- 备注 -->
			                        <label class="col-lg-2 col-sm-3 control-label" for="liveWay">居住方式：</label>
			                        <div class="col-lg-4">
			
			                            <select name="liveWay" class="form-control" id="liveWay" ng-model="detailParams.liveWay">
			                                <option value="1">单身居住</option>
			                                <option value="2">合伙居住</option>
			                                <option value="3">家庭居住</option>
			                                <option value="4">集体居住</option>
			                                <option value="9">其他</option>
			                            </select>
			                        </div>
			                    </div>
			
			                    <div class="line line-dashed b-b line-lg pull-in"></div>
			                    <div class="form-group btnBox" style="width: 100%">
			                        <div style="text-align: center">
			                            <button type="reset" class="btn w-xs addNew">重置</button>
			                            <button type="submit" class="btn btn-info w-xs addNew">保存</button>
			                        </div>
			                    </div>
			                </div>
                        </form>
                    </div>
                </div>
            </div>
        </div>
    </div>
</script>
<style scoped>
    input[name='IcCardNo']::-ms-clear{display:none;}
    .icCardBox{
        width: 45%;
    }
    .dropdown-menu .btn-danger{padding: 8px 12px;}

    .modal.in .modal-dialog{
        width:1100px;
    }
    .form-group {
        width: 50%;
        float: left;
    }

    .form-group .col-lg-2 {
        width: 25%;
    }

    .form-group .col-lg-4 {
        width: 65%;
    }

    .app-content-body .content{
        margin-top:25px;
    }
    input[type='radio']{
        vertical-align: middle;
        width: 18px;
        height:18px;
        margin: 0;
        padding: 0;
        margin-right: 6px;
        cursor: pointer;
    }
    .timelimit{
        width: 200px;
        position: absolute;
        right:-210px;
        top:8px;
        border-bottom: 1px solid #f0f0f0;
        display: flex;
    }
    .timelimit span{
        font-size: 14px;
        cursor: pointer;
        color: #78a7ff;
        flex: 1;
        text-align: center;
    }
    .timelimit span:hover{
        color: orangered;
    }
    .readCard{
        line-height: 40px;
        background-color: #78a7ff;
        color: #fff;
        padding: 5px 10px;
        border-radius: 4px;
        cursor: pointer;
    }
    .readCard:hover{
        background-color: #6490f2;
    }
    .inputClose{
        display: inline-block;
        width: 18px;
        height: 18px;
        margin-left: 10px;
        color: red;
        cursor: pointer;
        position: absolute;
        right: 10px;
        top:7px;
        background-image:url(../../../../res/img/icon.png);
        background-repeat: no-repeat;
        background-position: 2px -35px;
    }

    .cityinput{
        width: 150px!important;
        border:1px solid #bdc3c7;
        border-radius: 4px;
        color: #acb8c5;
    }
    .cityinput option[attr='selected']{
        color: #000;
    }
    .readCardBtn,.readIcCard{
        line-height: 32px;
        padding: 0 10px;
        background-color:#78a7ff;
        border-radius: 4px;
        color: #fff;
        border:none;
        vertical-align: middle;
        margin-left: 8px;
    }
    .readCardBtn:hover,.readCardBtn:hover{
        background-color: #6490f2;
    }
    .form-control[readonly]{
    	background-color: #FFFFFF!important;
    	border: 1px solid #bdc3c7;
    }
    /*人员头像处理*/
    #headImag {
    	border:none;
    	height:80px;
    	width:80px;
    	position: absolute;
    	bottom: -58px;
    	left:15px;
        background-image: url("./res/img/person.png");
        background-repeat: no-repeat;
        background-size: 60%;
        background-position: center
    }

    .reminder{
        margin: 5px 0px 0px 0px;
        font-size: 12px;
        color:#FF0000;
        clear: both;
    }
    .t-reminder{
        margin-top: 40px;
    }

    
</style>
